<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <script src="https://file.ggxqce.com/web/vue.min.js"></script>
    <link rel="stylesheet" href="/dist/plugins/webuploader-0.1.5/webuploader.css">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--插件样式-->
    <link href="/dist/plugins/ztree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/dist/plugins/webuploader-0.1.5/webuploader.css">
    <!--OA主样式-->

    <style>
        .fj-tanzhongStyle {
            width: 100%;
            height: 29px;
            float: left;
            position: relative;
            margin-bottom: 1px;
            margin-top: 1px;
            border-radius: 3px;
            overflow: visible;
            font-size: 12px;
            background-color: #E3EAF4;

        }

        .fj-tanzhongStyle .name {
            width: 80%;
            line-height: 12px;
            text-align: left;
            height: 12px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            color: #666;
            position: absolute;
            left: 41px;
            top: 1px;
            cursor: pointer;
        }

        .fj-tanzhongStyle .del {
            position: absolute;
            right: 6px;
            top: 5px;
            font-size: 12px;
        }

        .fj-tanzhongStyle .img {
            float: left;
            vertical-align: middle;
            margin: -1px 0 0 4px;
            width: 32px;
            height: 32px;
            background-position: -32px -64px;
            background-image: url(/dist/img/fileico_v5.png);
            background-repeat: no-repeat;
            transform: scale(0.8, 0.8);
        }

        .fj-tanzhongStyle .fj-txt {
            background-position: -672px -64px;
        }

        .fj-tanzhongStyle .fj-xlsx, .fj-tanzhongStyle .fj-xls {
            background-position: -32px -64px;
        }

        .fj-tanzhongStyle .fj-docx, .fj-tanzhongStyle .fj-doc {
            background-position: -64px -64px;
        }

        .fj-tanzhongStyle .fj-pdf {
            background-position: -512px -64px;
        }

        .fj-tanzhongStyle .fj-zip, .fj-tanzhongStyle .fj-rar {
            background-position: -160px -64px;
        }

        .fj-tanzhongStyle .fj-png {
            background-position: -64px -96px;
        }

        .fj-tanzhongStyle .fj-jpg, .fj-tanzhongStyle .fj-jpeg {
            background-position: 0 -96px;
        }

        .fj-tanzhongStyle .fj-ppt, .fj-tanzhongStyle .fj-pptx {
            background-position: -96px -64px;
        }

        .fj-tanzhongStyle .info {
            height: 16px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            color: #B0B0B0;
            position: absolute;
            left: 41px;
            top: 18px;
            line-height: 160%;
            overflow: visible;
            font-size: 12px;
        }

        .fj-tanzhongStyle .del {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            color: #B0B0B0;
            position: absolute;
            left: 71px;
            top: 7px;
            /* line-height: 160%; */
            overflow: visible;
            font-size: 12px;
            text-align: left;
            width: 30px;
            line-height: 29px;

        }

        .fj-tanzhongStyle .down {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            color: #B0B0B0;
            position: absolute;
            left: 41px;
            top: 7px;
            /* line-height: 160%; */
            overflow: visible;
            font-size: 12px;
            text-align: left;
            width: 30px;
            line-height: 29px;
        }

        .fj-tanzhongStyle .nui-txt-suc {
            color: #3d882d !important;
        }

        .fj-one-tanzhongStyle {
        / / margin-bottom: 0;
        }

        [v-cloak] {
            display: none;
        }

        .table-detail td.td-tanZongStyle-line {
            padding: 1px !important;
            text-align: left !important;

        }

        .td-tanZongStyle-line input {
            box-shadow: inset 1px 1px 4px #333;
            height: 100% !important;
            padding-left: 4px !important;
        }

        .td-tanZongStyle-line textarea {
            box-shadow: inset 1px 1px 4px #333;
            display: block;
        }

        .table-detail td.td-tanZongStyle-line {
            height: 100% !important;
            padding: 1px !important;

        }

        .td-tanZongStyle-line input {
            height: 29px !important;
            box-shadow: inset 1px 1px 4px #333;
            padding-left: 4px !important;
        }

        .td-tanZongStyle-line textarea {
            box-shadow: inset 1px 1px 4px #333;
            display: block;
        }

        .td-tanZongStyle-line select {
            box-shadow: inset 1px 1px 4px #333;
            height: 29px !important;
            padding-left: 4px !important;
        }

        table td.td-tanZongStyle-line span, table td.td-tanZongStyle-line > div {
            display: block;
            max-height: 29px;
            line-height: 29px;
            overflow: hidden;
        }

        .webuploader-pick {
            background: url(/dist/img/fjT1.png) no-repeat 5px center;
            padding: 0 4px;
            height: 32px;
            line-height: 32px;
            margin: 0 auto;
            width: 55px;
            /*margin-top: 9px;*/
            border-radius: 4px;
            display: block;
        }

        .webuploader-pick-hover {
            color: #fff !important;
            background: url(/dist/img/fjT2.png) no-repeat 5px center;
            background-color: #0F6099;

        }

        table td.td-tanZongStyle-line > div.wyui-autocomplete-panel {
            display: none;
        }

        * {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            font-size: 12px;
        }

        body {
            margin: 1px;
            background: white;
        }

        .progressobj {
            display: flex;
            justify-content: space-between;
            height: 20px;
        }

        .jiaobiao, .jiaobiaoNew {
            position: relative;
        }

        .jiaobiao i {
            display: block;
            width: 0;
            height: 0;
            border-width: 0px 0 12px 12px;
            border-style: solid;
            border-color: transparent transparent transparent #2a8cec;
            position: absolute;
            top: 0px;
            left: 0px;
        }

        .progressobj .delfile {
            float: right;
            margin-right: 10px;
        }

        table {
            border-spacing: 0;
            border-collapse: collapse;
            display: table;
        }

        table.text-center, table.text-center td, table.text-center th {
            text-align: center;
            font-size: 12px;
        }

        .table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td {
            border: 1px solid #cbcbcd;
            font-weight: normal;
            height: 24px;
        }

        table th {
            background: #f8f8f8;
        }

        .table-bordered {
            border: 1px solid #cbcbcd;
        }

        .table {
            width: 100%;
            max-width: 100%;
        }

        .hidden {
            display: none;
        }

        .lineOne span {
            max-height: 24px;
            /*line-height: 24px;*/
            overflow: hidden;
            text-overflow: ellipsis;
            /*display: -webkit-box;*/
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }

        span.lineOne {
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
        }

        .mScrollBox {
            float: left;
            position: relative;
            overflow: hidden;
        }

        .infoReport {
            text-align: center;
            margin: 0;
            margin-bottom: 10px;
        }

        .moduleName {
            height: 20px;
            line-height: 20px;
            background: #f8f8f8;
            font-weight: bold;
            font-size: 14px;
        }

        .toggleDiv div {
            width: 50%;
            float: left;
            text-align: center;
        }

        .toggleDiv div.active {
            border-bottom: 2px solid #2289ee;
        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }

        .text-center {
            text-align: center;
        }

        .td-title {
            background-color: #F5F5F5;
        }

        element.style {
            width: 16%;
        }

        .table-detail {
            width: 100%;
            border-left: 1px solid #e8e8e9;
            border-top: 1px solid #e8e8e9;
            border-spacing: 0;
            /*table-layout: fixed;*/
        }

        .table-detail .td-title {
            background-color: #f5f5f5;
        }

        .table-detail td {
            border-right: 1px solid #e8e8e9;
            border-bottom: 1px solid #e8e8e9;
            padding-left: 0px !important;
            padding-right: 0px !important;
            padding-top: 0px !important;
            padding-bottom: 0px !important;
            height: 29px;
            /*line-height: 29px;*/
            text-align: center;
            position: relative;
            overflow: hidden;
            word-wrap: break-word;
        }

        .table-detail td input {
            display: inline-block;
            outline: none;
            border: 0;
            /*background: #F8F8F8;*/
            padding: 0;
            margin: 0;
            width: 93px;
            text-align: center;
            color: #2a8cec;
        }

        /* .table-detail td span{
             color: #2a8cec;
         }*/
        .table-detail td textarea, .table-detail td select {
            width: 100%;
            height: 100%;
            line-height: 100%;
            padding-top: 20px;
            padding-left: 6px;
            outline: none;
            resize: none;
            border: none;
            color: #2a8cec;
        }

        .table-detail td select {
            padding-top: 0px;
            padding-left: 0px;
            width: auto;
            border: none;
            color: #2a8cec;
        }

        .btn {
            border-radius: 3px;
            -webkit-box-shadow: none;
            box-shadow: none;
            border: 1px solid transparent;
        }

        .btn-primary {
            background-color: #228bee;
            border-color: #127ee5;
            color: #fff;
        }

        .btn-group-sm > .btn, .btn-sm {
            padding: 5px 10px;
            font-size: 12px;
            line-height: 1.5;
            border-radius: 3px;

        }

        .model-picker-input {
            opacity: 0 !important;
            top: -9999px;
            left: -9999px;
            position: absolute;
        }

        .model-picker-span {
            position: relative;
            display: block;
            outline: 0;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
            border-bottom: 1px solid #ccc;
            background-color: #fff;
            color: #ccc;
            cursor: pointer;
        }

        .model-picker-span > .placeholder {
            color: #aaa;
        }

        .model-picker-span > .arrow {
            position: absolute;
            top: 50%;
            right: 8px;
            width: 10px;
            margin-top: -3px;
            height: 5px;
            background: url(../images/drop-arrow.png) -10px -25px no-repeat;
        }

        .model-picker-span.focus,
        .model-picker-span.open {
            border-bottom-color: #46A4FF;
        }

        .model-picker-span.open > .arrow {
            background-position: -10px -10px;
        }

        .model-picker-span > .title > span {
            color: #333;
            padding: 5px;
            border-radius: 3px;
        }

        .model-picker-span > .title > span:hover {
            background-color: #f1f8ff;
        }

        .model-picker-dropdown {
            position: absolute;
            width: 315px;
            left: -9999px;
            top: -9999px;
            outline: 0;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
            z-index: 999999;
            display: none;
            min-width: 330px;
            margin-bottom: 20px;
            margin-top: 10px;
        }

        .model-select-wrap {
            width: 75%;
            box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
        }

        .model-select-tab {
            border-bottom: 1px solid #ccc;
            background: #f5f5f5;
            font-size: 13px;
        }

        .model-select-tab > a {
            display: inline-block;
            padding: 4px 20px;
            border-left: 1px solid #ccc;
            border-bottom: 1px solid transparent;
            color: #4D4D4D;
            text-align: center;
            outline: 0;
            text-decoration: none;
            cursor: pointer;
            font-size: 14px;
            margin-bottom: -1px;
        }

        .model-select-tab > a.active {
            background: #fff;
            border-bottom: 1px solid #fff;
            color: #46A4FF;
        }

        .model-select-tab > a:first-child {
            border-left: none;
        }

        .model-select-tab > a:last-child.active {
            border-right: 1px solid #ccc;
        }

        .model-select-content {
            width: 100%;
            min-height: 10px;
            background-color: #fff;
            /*padding: 5px 5px;*/
        }

        .model-select {
            font-size: 13px;
        }

        .model-select dl {
            line-height: 2;
            clear: both;
            padding: 3px 0;
            margin: 0;
        }

        .model-select dt {
            position: absolute;
            width: 2.5em;
            font-weight: 500;
            text-align: right;
            line-height: 2;
        }

        .model-select dd {
            margin-left: 0;
            line-height: 2;
        }

        .model-select.province dd {
            margin-left: 3em;
        }

        .model-select a {
            display: inline-block;
            padding: 0 10px;
            outline: 0;
            text-decoration: none;
            white-space: nowrap;
            margin-right: 2px;
            text-decoration: none;
            color: #333;
            cursor: pointer;
        }

        .model-select a:hover,
        .model-select a:focus {
            background-color: #f1f8ff;
            border-radius: 2px;
            color: #46A4FF;
        }

        .model-select a.active {
            background-color: #46A4FF;
            color: #fff;
            border-radius: 2px;
        }

        td {
            color: #2a8cec;
        }

        td.td-title, td select, td .filename, td.td-module {
            color: #333;
        }

        td.td-value, span {
            padding-left: 6px;
        }

        td.td-value {
            background-color: white;
        }

        .user {
            height: 30px;
            line-height: 30px;
            max-height: 30px;
            float: left;
            text-align: left;
            /*min-width: 32px;*/
            padding-left: 1px;
            overflow: hidden;
            cursor: pointer;
        }

        .user:hover {
            background-color: #cfd4d1;
        }

        td .lookFj {
            /*width: 100%;*/
            color: #2a8cec;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            position: relative;
            cursor: pointer;
            background: none;
            padding-left: 6px;
            text-align: left;
            height: 100%;
            width: 200px;
        }

        .fujian {
            /*display: inline-block;*/
            cursor: pointer;
            padding-left: 19px;
            background: url(/dist/img/fujian.png) no-repeat 6px center;
            color: #2a8cec;
        }

        .lineTwo span {
            line-height: 16px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            text-align: left;
        }

        .lineSpan {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            padding-right: 10px;
        }
    </style>
</head>
<body>
<iframe id="ifAttach" style="display:none"></iframe>
<div class="div-td-content-more"><i></i></div>
<section class="content" id="app" v-cloak>
    <!--<h4 class="text-center" style="margin:10px 10px;">{{money.main.title}}</h4>-->
    <div class="center" style="overflow:auto;overflow-x:hidden;padding-bottom: 51px;">
        <table class="table-detail">
            <tr>
                <td class="td-title" colspan="4" style="text-align: center;">基本信息</td>
            </tr>
            <tr>
                <td class="td-title" style="width:18%;">客户名称</td>
                <td clsss="td-value" style="width:32%;text-align: left;background-color: white;"><span class="lineOne">{{contract.main.buyer}}</span>
                </td>
                <td class="td-title" style="width:18%;">申请人</td>
                <td clsss="td-value" style="width:32%;text-align: left;background-color: white"><span>{{contract.main.applyName}}</span>
                </td>
            </tr>
            <tr>
                <td class="td-title">申请部门</td>
                <td clsss="td-value" style="text-align: left;background-color: white"><span>{{contract.main.applyDepart}}</span>
                </td>
                <td class="td-title">申请时间</td>
                <td clsss="td-value" style="text-align: left;background-color: white"><span>{{formatDate(contract.main.applyTime)}}</span>
                </td>
            </tr>
            <tr>
                <td class="td-title">交车日期</td>
                <td clsss="td-value" style="text-align: left;background-color: white"><span>{{contract.main.deliveryDate}}</span>
                </td>
                <td class="td-title">交车地址</td>
                <td clsss="td-value" style="text-align: left;background-color: white"><span>{{contract.main.deliveryAddress}}</span>
                </td>
            </tr>
            <tr>
                <td class="td-title">设备类型</td>
                <td clsss="td-value" style="text-align: left;background-color: white">
                    <span>{{contract.main.deviceType}}</span></td>
                <td class="td-title">品牌</td>
                <td clsss="td-value" style="text-align: left;background-color: white">
                    <span>{{contract.main.brandName}}</span></td>
            </tr>
            <tr>
                <td class="td-title">付款方式</td>
                <td clsss="td-value" style="text-align: left;background-color: white"><span
                        v-if="contract.main.buyType=='融资租赁打包'">
                        融资租赁(打包)
                    </span>
                    <span v-else>
                        {{contract.main.buyType}}
                    </span></td>
                <td class="td-title">型号</td>
                <td clsss="td-value" style="text-align: left;background-color: white">
                    <span>{{contract.main.modelName}}</span></td>
            </tr>
        </table>
        <!--首付款-->
        <template>
            <table class="table-detail" style="width: 100%;">
                <tr>
                    <td class="td-title" colspan="5" style="text-align: center;">首付款逾期罚息</td>
                </tr>
                <tr>
                    <td class="td-title" style="width: 20%">销售合同<br>还款日期</td>
                    <td class="td-title" style="width: 20%">约定还款<br>金额(元)</td>
                    <td class="td-title" style="width: 20%">剩余欠款<br>(元)</td>
                    <td class="td-title" style="width: 20%">逾期罚息<br>(元)</td>
                    <td class="td-title" style="width: 20%">免除金额<br>(元)</td>
                </tr>
            </table>
            <table class="table-detail">
                <template v-for="(item,i) in main.repaySFMent">
                    <tr>
                        <td class="td-tanZongStyle-line" style="text-align: center !important;width: 20%">
                            <span :class="changeRed('repaySFMent',i)?'jieQ':'yellow'" class="lineOne">{{item.repaymentDate}}</span>
                        </td>
                        <td class="td-tanZongStyle-line" style="text-align: center !important;width: 20%">
                            <span :class="changeRed('repaySFMent',i)?'jieQ':'yellow'"
                                  class="lineOne">{{fmoney(item.total)}}</span>
                        </td>
                        <td class="td-tanZongStyle-line" style="text-align: center !important;width: 20%"
                            :class="showToday(item,'qianKuan')?'bH':''">
                            <span class="lineOne">{{fmoney(item.remainingArrears)}}</span>
                        </td>
                        <td class="td-tanZongStyle-line" style="text-align: center !important;width: 20%"
                            :class="showToday(item,'faXi')?'bH':''">
                            <span class="lineOne">{{fmoney(item.overduePenalty)}}</span>
                        </td>
                        <td class="td-tanZongStyle-line" style="text-align: center !important;width: 20%">
                            {{fmoney(item.freeMoney)}}
                        </td>
                    </tr>
                    <tr>
                        <td class="td-title">免罚息说明</td>
                        <td clsss="td-value" colspan="4" style="text-align: left;">
                            <span>{{item.interestFreeReason}}</span></td>

                    </tr>
                    <tr>
                        <td class="td-title">免息凭证</td>
                        <td clsss="td-value" colspan="4">
                            <div class="fj-tanzhongStyle fj-one-tanzhongStyle" v-if="item.interestFreeAttachName">
                                <b :class="fjStyle(item.interestFreeAttachName)"></b>
                                <div class="name" :title="item.interestFreeAttachName"
                                     v-on:click="download(item.interestFreeAttachUrl,item.interestFreeAttachName)">
                                    {{item.interestFreeAttachName}}
                                </div>
                                <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                     v-on:click="download(item.interestFreeAttachUrl,item.interestFreeAttachName)">下载</a>
                                </div>
                            </div>
                        </td>
                    </tr>
                </template>
                <template v-for="(item,i) in main.repayDKMent">
                    <tr>
                        <td class="td-tanZongStyle-line" style="text-align: center !important;width: 20%">
                            <span :class="changeRed('repayDKMent',i)?'jieQ':'yellow'"  class="lineOne">{{item.repaymentDate}}</span>
                        </td>
                        <td class="td-tanZongStyle-line" style="text-align: center !important;width: 20%">
                            <span :class="changeRed('repayDKMent',i)?'jieQ':'yellow'"
                                  class="lineOne">{{fmoney(item.total)}}</span>
                        </td>
                        <td class="td-tanZongStyle-line" style="text-align: center !important;width: 20%"
                            :class="showToday(item,'qianKuan')?'bH':''">
                            <span class="lineOne">{{fmoney(item.remainingArrears)}}</span>
                        </td>
                        <td class="td-tanZongStyle-line" style="text-align: center !important;width: 20%"
                            :class="showToday(item,'faXi')?'bH':''">
                            <span class="lineOne">{{fmoney(item.overduePenalty)}}</span>
                        </td>
                        <td class="td-tanZongStyle-line" style="text-align: center !important;width: 20%">
                            {{fmoney(item.freeMoney)}}
                        </td>
                    </tr>
                    <tr>
                        <td class="td-title">免罚息说明</td>
                        <td clsss="td-value" colspan="4" style="text-align: left;">
                            <span>{{item.interestFreeReason}}</span></td>

                    </tr>
                    <tr>
                        <td class="td-title">免息凭证</td>
                        <td clsss="td-value" colspan="4">
                            <div class="fj-tanzhongStyle fj-one-tanzhongStyle" v-if="item.interestFreeAttachName">
                                <b :class="fjStyle(item.interestFreeAttachName)"></b>
                                <div class="name" :title="item.interestFreeAttachName"
                                     v-on:click="download(item.interestFreeAttachUrl,item.interestFreeAttachName)">
                                    {{item.interestFreeAttachName}}
                                </div>
                                <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                     v-on:click="download(item.interestFreeAttachUrl,item.interestFreeAttachName)">下载</a>
                                </div>
                            </div>
                        </td>
                    </tr>
                </template>
                <template
                        v-if="(!main.repaySFMent||main.repaySFMent.length<=0)&&(!main.repayDKMent||main.repayDKMent.length<=0)">
                    <tr>
                        <td colspan="5">当前没有逾期罚息</td>
                    </tr>
                </template>
            </table>
        </template>
        <!--融资租赁-->
        <template v-if="contract.main.buyType=='融资租赁'">
            <table class="table-detail" style="width: 100%;">
                <tr>
                    <td class="td-title" colspan="5" style="text-align: center;">销售合同逾期罚息</td>
                </tr>
                <tr>
                    <td class="td-title" style="width: 20%">销售合同<br>还款日期</td>
                    <td class="td-title" style="width: 20%">约定还款<br>金额(元)</td>
                    <td class="td-title" style="width: 20%">剩余欠款<br>(元)</td>
                    <td class="td-title" style="width: 20%">逾期罚息<br>(元)</td>
                    <td class="td-title" style="width: 20%">免除金额<br>(元)</td>

                </tr>
            </table>
            <table class="table-detail">
                <template v-for="(item,i) in main.repayRZMent">
                    <tr>
                        <td class="td-tanZongStyle-line" style="text-align: center !important;width: 20%">
                            <span :class="changeRed('repayRZMent',i)?'jieQ':'yellow'"  class="lineOne">{{item.repaymentDate}}</span>
                        </td>
                        <td class="td-tanZongStyle-line" style="text-align: center !important;width: 20%">
                                <span :class="changeRed('repayRZMent',i)?'jieQ':'yellow'"
                                      class="lineOne">{{fmoney(item.total)}}</span>
                        </td>
                        <td class="td-tanZongStyle-line" style="text-align: center !important;width: 20%"
                            :class="showToday(item,'qianKuan')?'bH':''">
                            <span class="lineOne">{{fmoney(item.remainingArrears)}}</span>
                        </td>
                        <td class="td-tanZongStyle-line" style="text-align: center !important;width: 20%"
                            :class="showToday(item,'faXi')?'bH':''">
                            <span class="lineOne">{{fmoney(item.overduePenalty)}}</span>
                        </td>
                        <td class="td-tanZongStyle-line" style="text-align: center !important;width: 20%">
                            {{fmoney(item.freeMoney)}}
                        </td>
                    </tr>
                    <tr>
                        <td class="td-title">免罚息说明</td>
                        <td clsss="td-value" colspan="4" style="text-align: left;">
                            <span>{{item.interestFreeReason}}</span></td>

                    </tr>
                    <tr>
                        <td class="td-title">免息凭证</td>
                        <td clsss="td-value" colspan="4">
                            <div class="fj-tanzhongStyle fj-one-tanzhongStyle" v-if="item.interestFreeAttachName">
                                <b :class="fjStyle(item.interestFreeAttachName)"></b>
                                <div class="name" :title="item.interestFreeAttachName"
                                     v-on:click="download(item.interestFreeAttachUrl,item.interestFreeAttachName)">
                                    {{item.interestFreeAttachName}}
                                </div>
                                <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                     v-on:click="download(item.interestFreeAttachUrl,item.interestFreeAttachName)">下载</a>
                                </div>
                            </div>
                        </td>
                    </tr>
                </template>
                <template v-if="!main.repayRZMent||main.repayRZMent.length<=0">
                    <tr>
                        <td colspan="5">当前没逾期罚息</td>
                    </tr>
                </template>
            </table>
        </template>
        <!--融资租赁打包-->
        <template v-if="contract.main.buyType=='融资租赁打包'">
            <table class="table-detail" style="width: 100%;">
                <tr>
                    <td class="td-title" colspan="5" style="text-align: center;">销售合同逾期罚息</td>
                </tr>
                <tr>
                    <td class="td-title" style="width: 20%">销售合同<br>还款日期</td>
                    <td class="td-title" style="width: 20%">约定还款<br>金额(元)</td>
                    <td class="td-title" style="width: 20%">剩余欠款<br>(元)</td>
                    <td class="td-title" style="width: 20%">逾期罚息<br>(元)</td>
                    <td class="td-title" style="width: 20%">免除金额<br>(元)</td>

                </tr>
            </table>
            <table class="table-detail">
                <template v-for="(item,i) in main.repayRZDBMent">
                    <tr>
                        <td class="td-tanZongStyle-line" style="text-align: center !important;width: 20%">
                            <span :class="changeRed('repayRZDBMent',i)?'jieQ':'yellow'"  class="lineOne">{{item.repaymentDate}}</span>
                        </td>
                        <td class="td-tanZongStyle-line" style="text-align: center !important;width: 20%">
                                <span :class="changeRed('repayRZDBMent',i)?'jieQ':'yellow'"
                                      class="lineOne">{{fmoney(item.total)}}</span>
                        </td>
                        <td class="td-tanZongStyle-line" style="text-align: center !important;width: 20%"
                            :class="showToday(item,'qianKuan')?'bH':''">
                            <span class="lineOne">{{fmoney(item.remainingArrears)}}</span>
                        </td>
                        <td class="td-tanZongStyle-line" style="text-align: center !important;width: 20%"
                            :class="showToday(item,'faXi')?'bH':''">
                            <span class="lineOne">{{fmoney(item.overduePenalty)}}</span>
                        </td>
                        <td class="td-tanZongStyle-line" style="text-align: center !important;width: 20%">
                            {{fmoney(item.freeMoney)}}
                        </td>
                    </tr>
                    <tr>
                        <td class="td-title">免罚息说明</td>
                        <td clsss="td-value" colspan="4" style="text-align: left;">
                            <span>{{item.interestFreeReason}}</span></td>

                    </tr>
                    <tr>
                        <td class="td-title">免息凭证</td>
                        <td clsss="td-value" colspan="4">
                            <div class="fj-tanzhongStyle fj-one-tanzhongStyle" v-if="item.interestFreeAttachName">
                                <b :class="fjStyle(item.interestFreeAttachName)"></b>
                                <div class="name" :title="item.interestFreeAttachName"
                                     v-on:click="download(item.interestFreeAttachUrl,item.interestFreeAttachName)">
                                    {{item.interestFreeAttachName}}
                                </div>
                                <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                     v-on:click="download(item.interestFreeAttachUrl,item.interestFreeAttachName)">下载</a>
                                </div>
                            </div>
                        </td>
                    </tr>
                </template>
                <template v-if="!main.repayRZDBMent||main.repayRZDBMent.length<=0">
                    <tr>
                        <td colspan="5">当前没逾期罚息</td>
                    </tr>
                </template>

            </table>
        </template>
        <!--内部分期-->
        <template v-if="contract.main.buyType=='内部分期'">
            <table class="table-detail" style="width: 100%;">
                <tr>
                    <td class="td-title" colspan="5" style="text-align: center;">内部分期逾期罚息</td>
                </tr>
                <tr>
                    <td class="td-title" style="width: 20%">销售合同<br>还款日期</td>
                    <td class="td-title" style="width: 20%">约定还款<br>金额(元)</td>
                    <td class="td-title" style="width: 20%">剩余欠款<br>(元)</td>
                    <td class="td-title" style="width: 20%">逾期罚息<br>(元)</td>
                    <td class="td-title" style="width: 20%">免除金额<br>(元)</td>

                </tr>
            </table>
            <table class="table-detail">
                <template v-for="(item,i) in main.repayFQMent">
                    <tr>
                        <td class="td-tanZongStyle-line" style="text-align: center !important;width: 20%">
                            <span :class="changeRed('repayFQMent',i)?'jieQ':'yellow'"  class="lineOne">{{item.repaymentDate}}</span>
                        </td>
                        <td class="td-tanZongStyle-line" style="text-align: center !important;width: 20%">
                                <span :class="changeRed('repayFQMent',i)?'jieQ':'yellow'"
                                      class="lineOne">{{fmoney(item.total)}}</span>
                        </td>
                        <td class="td-tanZongStyle-line" style="text-align: center !important;width: 20%"
                            :class="showToday(item,'qianKuan')?'bH':''">
                            <span class="lineOne">{{fmoney(item.remainingArrears)}}</span>
                        </td>
                        <td class="td-tanZongStyle-line" style="text-align: center !important;width: 20%"
                            :class="showToday(item,'faXi')?'bH':''">
                            <span class="lineOne">{{fmoney(item.overduePenalty)}}</span>
                        </td>
                        <td class="td-tanZongStyle-line" style="text-align: center !important;width: 20%">
                            {{fmoney(item.freeMoney)}}
                        </td>
                    </tr>
                    <tr>
                        <td class="td-title">免罚息说明</td>
                        <td clsss="td-value" colspan="4" style="text-align: left;">
                            <span>{{item.interestFreeReason}}</span></td>

                    </tr>
                    <tr>
                        <td class="td-title">免息凭证</td>
                        <td clsss="td-value" colspan="4">
                            <div class="fj-tanzhongStyle fj-one-tanzhongStyle" v-if="item.interestFreeAttachName">
                                <b :class="fjStyle(item.interestFreeAttachName)"></b>
                                <div class="name" :title="item.interestFreeAttachName"
                                     v-on:click="download(item.interestFreeAttachUrl,item.interestFreeAttachName)">
                                    {{item.interestFreeAttachName}}
                                </div>
                                <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                     v-on:click="download(item.interestFreeAttachUrl,item.interestFreeAttachName)">下载</a>
                                </div>
                            </div>
                        </td>
                    </tr>
                </template>
                <template v-if="!main.repayFQMent||main.repayFQMent.length<=0">
                    <tr>
                        <td colspan="5">当前没逾期罚息</td>
                    </tr>
                </template>
            </table>
        </template>
        <!--审批进度-->
        <table class="table-detail" style="width: 100%;table-layout: auto;">
            <tr>
                <td class="td-title" colspan="4" style="text-align: center;width: 100%;">审批进度</td>
            </tr>
            <tr v-for="(item,i) in contract.auditors">
                <td class="td-title" style="width: 18%">
                    <span>第{{i+1}}审核人</span>
                </td>
                <td style="width: 32%;text-align: left;">
                    <span>{{item.roleName}}-{{item.auditorName}}</span>
                </td>
                <td style="width: 18%;text-align: left;">
                    <span v-if="item.auditFlag==0" style="color:red;">{{convertAuditFlagToName(item.auditFlag)}}</span>
                    <span v-else>{{convertAuditFlagToName(item.auditFlag)}}</span>
                </td>
                <td style="width: 32%;text-align: left;">
                    <span v-if="item.auditTime">{{formatDate(item.auditTime)}}</span>
                    <span v-else></span>
                </td>
            </tr>
            <tr>
                <td class="td-title" style="width:16%;">抄送人</td>
                <td colspan="5">
                    <div id="user" style="padding-left:6px;">
                        <div v-for="(user,i) in contract.copiers" class="user">
                            {{user.copierName}};
                        </div>
                        <!--<input v-if="" class="pull-left copier" id="txtCopier"-->
                        <!--style="width:100px"-->
                        <!--type="text" />-->
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <div class="south no-print"
         style="height:50px;line-height:50px;text-align:center;bottom:0;position: fixed;width: 100%;">
        <div v-if="shOrSq=='sh'&&lookType=='sh'"
             value="" class="" @click="audit('tongguo')"
             style="background-color: #228bee;width: 50%;float:left;color:#fff;font-size: 14px;position: relative">
            <span style="position: absolute;width:1px;height:14px;font-size:20px;right:-1px;top:-3px;">|</span>
            通过
        </div>
        <div v-if="shOrSq=='sh'&&lookType=='sh'"
             value="" class="" @click="audit('bohui')"
             style="background-color: #228bee;width: 50%;float:left;color:#fff;font-size: 14px">驳回
        </div>
    </div>
</section>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="/dist/plugins/scroll/myScroll.js"></script>
<!--框架已定义 JS-->
<!--oa自定义  JS-->
<script src="/dist/js/oaApp.js"></script>
<script src="/page/apply/contract/Template.js?t=42e28def"></script>

<script type="text/javascript" src="/dist/js/pages/common/commonService.js"></script>
<script type="text/javascript" src="/dist/js/pages/common/changeMoneyToChinese.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<script src="/dist/plugins/webuploader-0.1.5/webuploader.min.js"></script>
<script>
    $.ajaxSetup({
        global: true,
        type: "POST",
        cache: false,
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        beforeSend: function () {
        },
        complete: function () {

        },
        error: function (e) {
            alert('error' + e.responseText);
        }
    });
    $.extend($.wyui, {
        postMethod: function (url, data, callback, sync, id) {
            if (!id) {
                id = "#app"
            }
            $.ajax({
                url: server.ip + url,
                async: sync ? false : true,
                data: JSON.stringify(data),
                beforeSend: function () {

                },
                complete: function () {
                    setTimeout(function () {
                    }, 1000);

                },
                success: function (r) {
                    if (!r.e.code) {
                        callback(r.data.sendData);
                    } else {
                        alert(r.e.desc);
                    }
                },
                error: function (e) {
                    alert(url + e.responseText);
                }
            });
        },
    });
</script>
<script>
    $(function () {
        $("body").on("click", ".lineOne", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {

                var text = $(this).text();
                if (text != "" && text != "-") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
    $(function () {
        $("body").on("click", ".divMore", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {

                var text = $(this).val();
                if (text != "" && text != "-") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script>
    // 注册一个局自定义指令 `v-inputOnce`
    Vue.directive('onedate', {
        // 当被绑定的元素插入到 DOM 中时……
        inserted: function (el) {
            // if($(el).hasClass("otherInput")){
            el.click()
            // }else{
            //     el.focus()
            //     el.blur()
            // }
            //聚焦元素

        },
        componentUpdated: function (el, binding) {
            // 聚焦元素


        }
    })
    // 注册一个局自定义指令 `v-inputOnce`
    Vue.directive('autoinput', {
        // 当被绑定的元素插入到 DOM 中时……
        inserted: function (el, binding) {
            var idx = binding.value;
            $(el).autoComplete({
                url: server.ip + urlConfig.system.user.getTop10ByNameUser,
                render: function (users, panel) {
                    for (var i = 0; i < users.length; i++) {
                        $("<li></li>").data("autoComplete",
                            users[i]).html("<a>" + users[i].name + "&nbsp;&nbsp;&nbsp;" +
                            "(" + "&nbsp;" + users[i].companyName + "-" + users[i].departName + "-" + users[i].roleName + "&nbsp;" + ") " + "</a>")
                            .appendTo(panel);
                    }
                },
                selected: function (user) {
                    console.log($(el))
                    if ($(el).hasClass("auditorName")) {
                        app.contract.auditors[idx].auditorId = user.id;
                        app.contract.auditors[idx].auditorName = user.roleName + "-" + user.name;
                    } else if ($(el).hasClass("copier")) {
                        var userIds = new Array();
                        for (var i = 0; i < app.contract.auditors.length; i++) {
                            userIds.push(app.contract.auditors[i].auditorId);
                        }
                        for (var i = 0; i < app.contract.copiers.length; i++) {
                            userIds.push(app.contract.copiers[i].userId);
                        }
                        if ($.inArray(user.id, userIds) == -1) {
                            app.contract.copiers.push({userId: user.id, copierName: user.name});
                        } else {
                            alert("审核人、抄送人不能重复输入");
                        }
                        $(el).val("");
                    }
                    return false;
                },
                height: 210,
                width: 300
            });

        }
    })
</script>
<script type="text/javascript">
    function refresh() {
        $.wyui.page.getByPage();
    }

    var app = new Vue({
            el: '#app',
            data: {
                copierSelectedIdx: -1,
                id: getUrlParamObj().id,
                shOrSq: getUrlParamObj().shOrSq,
                lookType: getUrlParamObj().lookType,
                userId: getUrlParamObj().userId,
                userName: getUrlParamObj().userName,
                pageType: "edit",//页面类型
                deviceTypeList: [
                    {text: '', value: ''},
                    {text: '正常使用', value: '正常使用'},
                    {text: '工地停工', value: '工地停工'},
                    {text: '故障停工', value: '故障停工'},
                    {text: '其他', value: '其他'}
                ],
                contractTypeList: ['sales'],
                buyTypeList: [
                    {name: '全款', value: '全款'},
                    {name: '内部分期', value: '内部分期'},
                    {name: '融资租赁', value: '融资租赁'},
                ],
                customerTypeList: [
                    {name: '', value: ''},
                    {name: '', value: ''},
                    {name: 'T类：拖车客户', value: 'T类：拖车客户'},
                    {name: 'F类：已转法务', value: 'F类：已转法务'},
                    {name: '已结清', value: '已结清'},
                ],
                contract: {
                    checkedIds: [],
                    checkedIdString: "",
                    checkedIdStrings: "",
                    createUserId: getCurrentUser().id,
                    createUserName: getCurrentUser().name,
                    main: {city: "", customerCredit: ''}
                    ,
                    acceptance: {}
                    ,
                    commitment: {}
                    ,
                    confidentiality: {}
                    ,
                    guarantee: {}
                    ,
                    repaymentList: [],
                    repaymentFQList: [],
                    repaymentRZList: [],
                    repaymentDKList: [],
                    repaymentSFList: [],
                    repaymentRZDBList: [],
                    financingRZDBList: [],
                    financingRZList: [],
                    collectionList: [],
                    availableList: [],
                    regionManagerList: [],//区域经理
                    bigRegionManagerList: [],//大区经理
                    regionSupportList: [],//区域支持
                    creditorManagerList: [],//债权经理
                    dataManagerList: [],//应收专员
                    replacement: {
                        replacementsName: ['wjj'],
                        description: "",
                        wjj: [
                            new Template.jiuJi('挖掘机')
                        ],
                        zzj: [
                            new Template.jiuJi('装载机')
                        ],
                        qiChe: [
                            new Template.qiChe()
                        ],
                        fangWu: [
                            new Template.fangWu()
                        ],
                        other: [
                            new Template.other()
                        ]

                    }
                    ,
                    sales: {}
                    ,
                    supplementary: {},
                    guarantorList: [
                        new Template.guarantorTem()
                    ],
                },
                contractCopy: {
                    main: {city: "", customerCredit: ''}
                    ,
                    acceptance: {}
                    ,
                    commitment: {}
                    ,
                    confidentiality: {}
                    ,
                    guarantee: {}
                    ,
                    repaymentList: [],
                    repaymentFQList: [],
                    repaymentRZList: [],
                    repaymentDKList: [],
                    repaymentSFList: [],
                    repaymentRZDBList: [],
                    financingRZDBList: [],
                    financingRZList: [],
                    collectionList: [],
                    replacement: {
                        replacementsName: ['wjj'],
                        description: "",
                        wjj: [
                            new Template.jiuJi('挖掘机')
                        ],
                        zzj: [
                            new Template.jiuJi('装载机')
                        ],
                        qiChe: [
                            new Template.qiChe()
                        ],
                        fangWu: [
                            new Template.fangWu()
                        ],
                        other: [
                            new Template.other()
                        ]

                    }
                    ,
                    sales: {}
                    ,
                    supplementary: {},
                    guarantorList: [
                        new Template.guarantorTem()
                    ],
                },
                auditors: [],
                copiers: [],
                history: [],
                companyInfo: {},
                main: {
                    city: "",
                    regionalSupportName: '',
                    repayMent: [
                        new Template.repayMent()
                    ],
                    repayRZMentFn: [],
                    repayRZMentFnDB: [],
                    repayFQMent: [],
                    repayRZMent: [
                        new Template.repayRZMentList('')
                    ],
                    repayRZDBMent: [
                        new Template.repayRZMentList('')
                    ],
                    repaySFMent: [
                        new Template.repaySFMentList('')
                    ],
                    repayDKMent: [],
                },
            },
            computed: {

                getSalesTotal: function () {
                    //合同中首付款金额+保证金+手续费+担保费+保险费+GPS费
                    return fmoney(Number(this.contract.sales.firstPayment) + Number(this.contract.sales.bond) + Number(this.contract.sales.serviceCharge) + Number(this.contract.sales.securityCharge) + Number(this.contract.sales.insurancePremium) + Number(this.contract.sales.gpsCharge))
                },
                getBuyCarTotal: function () {
                    //合同中首付款金额+保证金+手续费+担保费+保险费+GPS费
                    var a = 0;
                    for (var i = 0; i < this.main.repayRZMent.length; i++) {
                        a = Number(this.main.repayRZMent[i].contractRepaymentAmount) + Number(a);
                    }
                    return fmoney(Number(this.contract.sales.firstPayment) + Number(this.contract.sales.bond) + Number(this.contract.sales.serviceCharge) + Number(this.contract.sales.securityCharge) + Number(this.contract.sales.insurancePremium) + Number(this.contract.sales.gpsCharge) + Number(a) - Number(this.contract.sales.bond))
                },
                getBuyCarTotalDB: function () {
                    //合同中首付款金额+保证金+手续费+担保费+保险费+GPS费
                    var a = 0;
                    for (var i = 0; i < this.main.repayRZDBMent.length; i++) {
                        a = Number(this.main.repayRZDBMent[i].contractRepaymentAmount) + Number(a);
                    }
                    return fmoney(Number(this.contract.sales.firstPayment) + Number(this.contract.sales.bond) + Number(this.contract.sales.serviceCharge) + Number(this.contract.sales.securityCharge) + Number(this.contract.sales.insurancePremium) + Number(this.contract.sales.gpsCharge) + Number(a) - Number(this.contract.sales.bond))
                },

            },
            methods: {
                onfocus1: function (i) {
                    var that = this;
                    that.currentfocus = i;
                },
                addItem: function (prop, className) {
                    this.contract[prop].push(new Money[className]());
                },
                delItem: function (prop, i, desc) {
                    if (this.contract[prop].length <= 1) {
                        alert("请至少保留一位审核人！")
                        return
                    }
                    this.contract[prop].splice(i, 1);
                },
                selectUser: function (i, prop) {
                    this.copierSelectedIdx = i;
                    this[prop] = i;
                },
                unselectUser: function () {
                    this.copierSelectedIdx = -1;
                },
                deleteUser: function (event) {
                    console.log(this.copierSelectedIdx)
                    if (event.keyCode == 46 || event.keyCode == 8 && event.target.value == "") {
                        if (this.copierSelectedIdx > -1) {
                            this.contract.copiers.splice(this.copierSelectedIdx, 1);
                            this.copierSelectedIdx = -1;
                        } else {
                            this.copierSelectedIdx = this.contract.copiers.length - 1;
                        }
                    }
                },
                convertAuditFlagToName: function (auditFlag) {
                    //auditFlag:-1,0,1,2,3,4,5,6
                    switch (Number(auditFlag)) {
                        case -1:
                            return "未提交";
                            break;
                        case 0:
                            return "待审核";
                            break;
                        case 1:
                            return "已通过";
                            break;
                        case 2:
                            return "已驳回";
                            break;
                        default :
                            break;
                    }
                },
                formatDate: function (now) {
                    var d = new Date(now);
                    var hour = d.getHours();
                    var minute = d.getMinutes();
                    var second = d.getSeconds();
                    var month = d.getMonth() + 1
                    var day = d.getDate();
                    if (hour < 10) {
                        hour = "0" + hour;
                    }
                    if (minute < 10) {
                        minute = "0" + minute;
                    }
//                    if(month<10){
//                        month="0"+month;
//                    }
//                    if(day<10){
//                        day="0"+day;
//                    }
                    return hour + ":" + minute + " " + month + "月" + day + "日";
                },
                showToday: function (item, str) {
                    // return false;
                    var dateTime = new Date().Format("yyyy-MM-dd");
                    if (dateTime == item.createTime) {
                        if (str && str == "faXi") {
                            if (item.hkType == '2') {
                                return true
                            } else {
                                return false;
                            }
                        } else if (str && str == "qianKuan") {
                            if (item.hkType == '1') {
                                return true
                            } else {
                                return false;
                            }
                        } else {
                            return true
                        }
                    }
                },
                audit: function (type) {
                    var that = this;
                    if (type == 'tongguo') {
                        if (!confirm("确定要通过吗？")) {
                            return;
                        }
                        advise = '同意！';
                        $.wyui.postMethod(urlConfig.receivable.applyAudit, {
                                id: that.id,
                                auditFlag: 1,
                                advise: '同意!',
                                userId: that.userId,
                                checkedIdString: that.contract.checkedIdString,
                                checkedIdStrings: that.contract.checkedIdStrings
                            },
                            function (r) {
                                alert("审核完成")
                                // var pageId = top.getActivePageId();
                                // top.refreshTabByName("应收台账", "no");
                                // top.refreshTabById(pageId);
                                // api.close();
                            }
                        )
                        ;
                    } else {
                        that.copierReturn();
                        //alert('请填写审核意见');
                        /*if (that.openType == 'dialog') {
                            api.close();
                        }*/
                        return;
                    }
                },
                copierReturn: function () {
                    var that = this;
                    $.dialog({
                        content: 'url:/page/apply/accountReceivable/copierReturnReasonApp.html?id=' + that.id + '&checkedIdStrings=' + that.contract.checkedIdStrings + '&checkedIdString=' + that.contract.checkedIdString + '&userId=' + that.userId + '&userName=' + that.userName,
                        title: '填写驳回原因',
                        width: 300,
                        height: 200,
                        max: false,
                        min: false,
                        lock: true
                    });
                }
                ,
                showToday2: function (item) {
                    var dateTime = new Date().Format("yyyy-MM-dd");
                    var flag = false;
                    if (dateTime == item.createTime) {
                        flag = true;
                        return flag;
                    }
                    if (item.repaymentParentList) {
                        for (var i = 0; i < item.repaymentParentList.length; i++) {
                            if (dateTime == item.repaymentParentList[i].createTime) {
                                flag = true;
                                return flag;
                            }
                        }
                    }
                },
                checked: function (item) {
                    var that = this;
                    console.log(that.main.repaySFMent)
                    var isCheck = item.isCheck
                    item.isCheck = !isCheck;
                    item.repaymentAmount = item.repaymentAmount + 1;
                    item.repaymentAmount = item.repaymentAmount - 1;
                    console.log(that.contract)
                    var idIndex = that.contract.checkedIds.indexOf(item.id)
                    if (idIndex >= 0) {
                        that.contract.checkedIds.splice(idIndex, 1)
                    } else {
                        that.contract.checkedIds.push(item.id)
                    }
                    console.log(that.contract.checkedIds);

                },
                IdNumber: function (idNum) {
                    if (idNum) {
                        var firstIdNum = idNum.substring(0, 10);
                        var lastIdNum = idNum.substring(idNum.length - 4, idNum.length);
                        return firstIdNum + "****" + lastIdNum;
                    }

                },
                goBack: function () {
                    var pageId = top.getActivePageId();
                    top.closeTabByPageId(pageId);
                },
                inputFocus: function (id) {
                    $("#" + id).focus();
                },
                fmoney: function (s, n) {

                    n = n > 0 && n <= 20 ? n : 2;
                    s = parseFloat((s + "").replace(/[^\d\.-]/g, "")).toFixed(n) + "";
                    var l = s.split(".")[0].split("").reverse(), r = s.split(".")[1],
                        t = "";
                    for (i = 0; i < l.length; i++) {
                        t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? "," : "");
                    }
                    var str = t.split("").reverse().join("") + "." + r;
                    str = str.replace("-,", "-")
                    if (str == 0.00) {
                        str = "-"
                    }

                    return str;
                },
                goRepayMent: function () {
                    var H = $(window).height() - 50;
                    top.$.dialog({
                        content: 'url:/page/apply/accountReceivable/oneClick.html?id=' + this.id + '&buyType=' + this.buyType + '&repayDate=' + this.repayDate + '&canUseMoney=' + this.canUseMoney,
                        title: '还款录入',
                        width: 1300,
                        height: H,
                        max: false,
                        min: false,
                        lock: true
                    });
                },
                strFormat: function (target, data) {
                    //此结果为了展示数据
                    var value = (target.value).trim();
                    value = value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g, '');
                    if (!value) {
                        value = 0
                    }
                    ;
                    //此结果为data存入数据
                    var dataList = data.split('.');

                    if (dataList.length > 0) {
                        if (dataList.length == 1) {
                            this[dataList[0]] = value;
                        }
                        if (dataList.length == 2) {
                            this[dataList[0]][dataList[1]] = value;
                        }
                        if (dataList.length == 3) {
                            this[dataList[0]][dataList[1]][dataList[2]] = value;
                        }
                        if (dataList.length == 4) {
                            this[dataList[0]][dataList[1]][dataList[2]][dataList[3]] = value;
                        }
                        if (dataList.length == 5) {
                            this[dataList[0]][dataList[1]][dataList[2]][dataList[3]][dataList[4]] = value;
                        }
                        if (dataList.length == 6) {
                            this[dataList[0]][dataList[1]][dataList[2]][dataList[3]][dataList[4]][dataList[5]] = value;
                        }
                    }
                    target.value = this.fmoney(value);
                    if (target.value == "0.00") {
                        target.value = '';
                    }
                    if (!$(target).parents("table").hasClass("sxtable")) {
                        // this.calMoney();
                    }
                },
                strFormatF: function (target, data) {
                    var value = '';
                    var dataList = data.split('.');

                    if (dataList.length > 0) {
                        if (dataList.length == 1) {
                            value = this[dataList[0]]
                        }
                        if (dataList.length == 2) {
                            value = this[dataList[0]][dataList[1]]
                        }
                        if (dataList.length == 3) {
                            value = this[dataList[0]][dataList[1]][dataList[2]]
                        }
                        if (dataList.length == 4) {
                            value = this[dataList[0]][dataList[1]][dataList[2]][dataList[3]]
                        }
                        if (dataList.length == 5) {
                            value = this[dataList[0]][dataList[1]][dataList[2]][dataList[3]][dataList[4]]
                        }
                        if (dataList.length == 6) {
                            value = this[dataList[0]][dataList[1]][dataList[2]][dataList[3]][dataList[4]][dataList[5]]
                        }

                    }
                    if (!value || value == '0.00') {
                        value = '';
                    }
                    target.value = value;
                    if (target.value == "0.00") {
                        target.value = '';
                    }

                },
                changeRedFn: function (type, i) {
                    var flag = true;
                    var nowDate = this.getNowDate();
                    if (!this.main[type][i].advancesDate) {
                        if (this.compareDate(nowDate, this.main[type][i].financingDate)) {
                            flag = false;
                            return flag;
                        }
                    } else {
                        if ((this.main[type][i].remainingArrearss != '0' || this.main[type][i].jroverduePenalty != '0') && this.compareDate(nowDate, this.main[type][i].financingDate)) {
                            if (this.main[type][i].remainingArrearss != '0' || this.main[type][i].jroverduePenalty != '0') {
                                flag = false;
                                return flag;
                            }
                            if (this.compareDateDE(this.main[type][i].advancesDate, this.main[type][i].financingDate)) {
                                flag = false;
                                return flag;
                            }
                        }
                        if (this.main[type][i].repaymentParentList) {
                            for (var j = 0; j < this.main[type][i].repaymentParentList.length; j++) {
                                if (this.main[type][i].repaymentParentList[j].remainingArrearss != '0' && this.compareDate(nowDate, this.main[type][i].repaymentParentList[j].financingDate)) {
                                    if (this.compareDateDE(this.main[type][i].repaymentParentList[j].advancesDate, this.main[type][i].repaymentParentList[j].financingDate)) {
                                        flag = false;
                                        return flag;
                                    }
                                }
                            }
                        }
                    }
                    return flag;
                },
                getNumber: function (str, number) {
                    var returnNumber;
                    var that = this;
                    if (str == "担保") {
                        if (that.zhihuan === "1") {
                            number = Number(number) + 1;
                        }
                        if (that.diankuan === "1") {
                            number = Number(number) + 1;
                        }
                    }
                    if (str == "条款") {
                        if (that.buyType != '全款') {
                            number = Number(number) + 1;
                        }
                        if (that.zhihuan === "1") {
                            number = Number(number) + 1;
                        }
                        if (that.diankuan === "1") {
                            number = Number(number) + 1;
                        }
                    }
                    return that.number2big(number)
                },
                showDatePicker: function (e, item, type) {
                    var that = this;
                    WdatePicker({
                        onpicked: function (dp) {
                            if (type == 'deliveryDate') {
                                that.contract.main.deliveryDate = dp.cal.getNewDateStr();
                            } else if (type == 'paymentTime') {
                                that.contract.main.paymentTime = dp.cal.getNewDateStr();
                            } else if (type == 'actualRepaymentDate') {
                                item.actualRepaymentDate = dp.cal.getNewDateStr();
                            } else if (type == 'repaymentDate') {
                                item.repaymentDate = dp.cal.getNewDateStr();
                            } else if (type == 'financingDate') {
                                item.financingDate = dp.cal.getNewDateStr();
                            } else if (type == 'advancesDate') {
                                item.advancesDate = dp.cal.getNewDateStr();
                            } else if (type == 'collectionDate') {
                                item.collectionDate = dp.cal.getNewDateStr();
                            }

                            return true;
                        }
                    });
                    $(e.target).blur();
                },
                save: function (type) {
                    var that = this;
                    that.contract.createUserId = getCurrentUser().id,
                        that.contract.createUserName = getCurrentUser().name,
                        that.contract.departName = getCurrentUser().departName,
                        that.contract.repaymentFQList = that.main.repayFQMent;
                    that.contract.repaymentDKList = that.main.repayDKMent;
                    that.contract.repaymentRZList = that.main.repayRZMent;
                    that.contract.repaymentRZDBList = that.main.repayRZDBMent;
                    that.contract.repaymentSFList = that.main.repaySFMent;
                    console.log(that.contract.checkedIds)
                    var checkedLists = "'',";
                    for (var i = 0; i < that.contract.checkedIds.length; i++) {
                        if (that.contract.checkedIds[i] != "") {
                            checkedLists = checkedLists + "'" + that.contract.checkedIds[i] + "',";
                        }
                    }
                    if (checkedLists != "") {
                        that.contract.checkedIdString = checkedLists.substring(0, checkedLists.length - 1);
                    }
                    $.wyui.postMethod(urlConfig.receivable.interestFreeApply, trimRN(that.contract), function (data) {
                        var pageId = top.getActivePageId();
                        top.refreshTabByName("应收台账", "no");
                        top.refreshTabById(pageId);
                        api.close();
                    });
                },
                number2big: function (number) {
                    switch (Number(number)) {
                        case 1:
                            return '一';
                            break;
                        case 2:
                            return '二';
                            break;
                        case 3:
                            return '三';
                            break;
                        case 4:
                            return '四';
                            break;
                        case 5:
                            return '五';
                            break;
                        case 6:
                            return '六';
                            break;
                        case 7:
                            return '七';
                            break;
                        case 8:
                            return '八';
                            break;
                        case 9:
                            return '九';
                            break;
                        case 10:
                            return '十';
                            break;
                    }
                },
                init: function (demo1) {
                    var that = this;
                    console.log(demo1);
                    setTimeout(function () {
                        var demo = demo1;
                        var name = demo.attr("id");
                        var pid = demo.attr('pid');
                        var thisid = demo.attr("thisid")
                        var nameValue = name + "Name";
                        var uploader = WebUploader.create({
                            // 选完文件后，是否自动上传。
                            auto: true,
                            // swf文件路径
                            swf: "/statics/plugin/webuploader-0.1.5/Uploader.swf",
                            // 文件接收服务端。
                            server: server.fjIp + "/attach/uploadFile.json",
                            // 选择文件的按钮。可选。
                            // 内部根据当前运行是创建，可能是input元素，也可能是flash.
                            pick: '#' + demo.attr("id"),
                            duplicate: true
                        });
                        // 文件上传过程中创建进度条实时显示。
                        uploader.on('uploadProgress', function (file, percentage) {
                            var $li = $('#' + file.id),
                                $percent = $li.find('.progress span');
                            // 避免重复创建
                            if (!$percent.length) {
                                $percent = $('<p class="progress"><span></span></p>')
                                    .appendTo($li)
                                    .find('span');
                            }
                            $percent.css('width', percentage * 100 + '%');
                        });
                        uploader.on("uploadStart", function () {
                            $("#progress").show();
                        });
                        uploader.on("uploadComplete", function () {
                            $("#progress").hide();
                        });
                        // 文件上传成功，给item添加成功class, 用样式标记上传成功。
                        uploader.on('uploadSuccess', function (file, response) {
                            if (name.substring(0, name.length - 1) == 'repayDKMent') {
                                var i = name.substring(name.length - 1, name.length)
                                that.main.repayDKMent[i].interestFreeAttachName = response.name;
                                that.main.repayDKMent[i].interestFreeAttachUrl = response.url;
                                $("#" + "repayDKMent" + i).hide();
                            } else if (name.indexOf('repayDKMentrepaymentParentList') > -1) {
                                that.main.repayDKMent[pid].repaymentParentList[thisid].interestFreeAttachName = response.name;
                                that.main.repayDKMent[pid].repaymentParentList[thisid].interestFreeAttachUrl = response.url;
                                $("#" + name).hide();
                            } else if (name.substring(0, name.length - 1) == 'repayFQMent') {
                                var i = name.substring(name.length - 1, name.length)
                                that.main.repayFQMent[i].interestFreeAttachName = response.name;
                                that.main.repayFQMent[i].interestFreeAttachUrl = response.url;
                                $("#" + "repayFQMent" + i).hide();
                            } else if (name.indexOf('repayFQMentrepaymentParentList') > -1) {
                                that.main.repayFQMent[pid].repaymentParentList[thisid].interestFreeAttachName = response.name;
                                that.main.repayFQMent[pid].repaymentParentList[thisid].interestFreeAttachUrl = response.url;
                                $("#" + name).hide();
                            } else if (name.substring(0, name.length - 1) == 'repayRZMent') {
                                var i = name.substring(name.length - 1, name.length)
                                that.main.repayRZMent[i].interestFreeAttachName = response.name;
                                that.main.repayRZMent[i].interestFreeAttachUrl = response.url;
                                $("#" + "repayRZMent" + i).hide();
                            } else if (name.indexOf('repayRZMentrepaymentParentList') > -1) {
                                that.main.repayRZMent[pid].repaymentParentList[thisid].interestFreeAttachName = response.name;
                                that.main.repayRZMent[pid].repaymentParentList[thisid].interestFreeAttachUrl = response.url;
                                $("#" + name).hide();
                            } else if (name.substring(0, name.length - 1) == 'repayRZDBMent') {
                                var i = name.substring(name.length - 1, name.length)
                                that.main.repayRZDBMent[i].interestFreeAttachName = response.name;
                                that.main.repayRZDBMent[i].interestFreeAttachUrl = response.url;
                                $("#" + "repayRZDBMent" + i).hide();
                            }
                            else if (name.indexOf('repayRZDBMentrepaymentParentList') > -1) {
                                that.main.repayRZDBMent[pid].repaymentParentList[thisid].interestFreeAttachName = response.name;
                                that.main.repayRZDBMent[pid].repaymentParentList[thisid].interestFreeAttachUrl = response.url;
                                $("#" + name).hide();
                            } else if (name.substring(0, name.length - 1) == 'repaySFMent') {
                                var i = name.substring(name.length - 1, name.length)
                                that.main.repaySFMent[i].interestFreeAttachName = response.name;
                                that.main.repaySFMent[i].interestFreeAttachUrl = response.url;
                                $("#" + "repaySFMent" + i).hide();
                            } else if (name.indexOf('repaySFMentrepaymentParentList') > -1) {
                                that.main.repaySFMent[pid].repaymentParentList[thisid].interestFreeAttachName = response.name;
                                that.main.repaySFMent[pid].repaymentParentList[thisid].interestFreeAttachUrl = response.url;
                                $("#" + name).hide();
                            }
                        });
                        // 文件上传失败，显示上传出错。
                        uploader.on('uploadError', function (file) {
                            alert("上传失败！");
                        });
                        that.hide()
                        //that.addequals();
                    }, 500);

                },
                fjStyle: function (fjName) {
                    if (fjName) {
                        var type = fjName.substring(fjName.lastIndexOf('.') + 1);
                        return 'img fj-' + type
                    }
                    return 'img'
                },
                hide: function () {
                    var that = this;
                    setTimeout(function () {
                        if (that.main.repayDKMent) {
                            for (var i = 0; i < that.main.repayDKMent.length; i++) {
                                if (that.main.repayDKMent[i].interestFreeAttachName != null && that.main.repayDKMent[i].interestFreeAttachName != "" && that.main.repayDKMent[i].interestFreeAttachName != undefined) {
                                    $("#" + "repayDKMent" + i).hide();
                                }
                                if (that.main.repayDKMent[i].repaymentParentList) {
                                    for (var b = 0; b < that.main.repayDKMent[i].repaymentParentList.length; b++) {
                                        if (that.main.repayDKMent[i].repaymentParentList[b].interestFreeAttachName != null && that.main.repayDKMent[i].repaymentParentList[b].interestFreeAttachName != "" && that.main.repayDKMent[i].repaymentParentList[b].interestFreeAttachName != undefined) {
                                            $("#" + "repayDKMentrepaymentParentList" + i + b).hide();
                                        }
                                    }
                                }
                            }
                        }
                        if (that.main.repayFQMent) {
                            for (var i = 0; i < that.main.repayFQMent.length; i++) {
                                if (that.main.repayFQMent[i].interestFreeAttachName != null && that.main.repayFQMent[i].interestFreeAttachName != "" && that.main.repayFQMent[i].interestFreeAttachName != undefined) {
                                    $("#" + "repayFQMent" + i).hide();
                                }
                                if (that.main.repayFQMent[i].repaymentParentList) {
                                    for (var b = 0; b < that.main.repayFQMent[i].repaymentParentList.length; b++) {
                                        if (that.main.repayFQMent[i].repaymentParentList[b].interestFreeAttachName != null && that.main.repayFQMent[i].repaymentParentList[b].interestFreeAttachName != "" && that.main.repayFQMent[i].repaymentParentList[b].interestFreeAttachName != undefined) {
                                            $("#" + "repayFQMentrepaymentParentList" + i + b).hide();
                                        }
                                    }
                                }

                            }
                        }
                        if (that.main.repayRZMent) {
                            for (var i = 0; i < that.main.repayRZMent.length; i++) {
                                if (that.main.repayRZMent[i].interestFreeAttachName != null && that.main.repayRZMent[i].interestFreeAttachName != "" && that.main.repayRZMent[i].interestFreeAttachName != undefined) {
                                    $("#" + "repayRZMent" + i).hide();
                                }
                                if (that.main.repayRZMent[i].repaymentParentList) {
                                    for (var b = 0; b < that.main.repayRZMent[i].repaymentParentList.length; b++) {
                                        if (that.main.repayRZMent[i].repaymentParentList[b].interestFreeAttachName != null && that.main.repayRZMent[i].repaymentParentList[b].interestFreeAttachName != "" && that.main.repayRZMent[i].repaymentParentList[b].interestFreeAttachName != undefined) {
                                            $("#" + "repayRZMentrepaymentParentList" + i + b).hide();
                                        }
                                    }
                                }

                            }
                        }
                        if (that.main.repayRZDBMent) {
                            for (var i = 0; i < that.main.repayRZDBMent.length; i++) {
                                if (that.main.repayRZDBMent[i].interestFreeAttachName != null && that.main.repayRZDBMent[i].interestFreeAttachName != "" && that.main.repayRZDBMent[i].interestFreeAttachName != undefined) {
                                    $("#" + "repayRZDBMent" + i).hide();
                                }
                                if (that.main.repayRZDBMent[i].repaymentParentList) {
                                    for (var b = 0; b < that.main.repayRZDBMent[i].repaymentParentList.length; b++) {
                                        if (that.main.repayRZDBMent[i].repaymentParentList[b].interestFreeAttachName != null && that.main.repayRZDBMent[i].repaymentParentList[b].interestFreeAttachName != "" && that.main.repayRZDBMent[i].repaymentParentList[b].interestFreeAttachName != undefined) {
                                            $("#" + "repayRZDBMentrepaymentParentList" + i + b).hide();
                                        }
                                    }
                                }

                            }
                        }
                        if (that.main.repaySFMent) {
                            for (var i = 0; i < that.main.repaySFMent.length; i++) {
                                if (that.main.repaySFMent[i].interestFreeAttachName != null && that.main.repaySFMent[i].interestFreeAttachName != "" && that.main.repaySFMent[i].interestFreeAttachName != undefined) {
                                    $("#" + "repaySFMent" + i).hide();
                                }
                                if (that.main.repaySFMent[i].repaymentParentList) {
                                    for (var b = 0; b < that.main.repaySFMent[i].repaymentParentList.length; b++) {
                                        if (that.main.repaySFMent[i].repaymentParentList[b].interestFreeAttachName != null && that.main.repaySFMent[i].repaymentParentList[b].interestFreeAttachName != "" && that.main.repaySFMent[i].repaymentParentList[b].interestFreeAttachName != undefined) {
                                            $("#" + "repaySFMentrepaymentParentList" + i + b).hide();
                                        }
                                    }
                                }

                            }
                        }
                    })
                },
                download: function (attachId, fileName) {
                    downloadFile(attachId,fileName)
                    return false;
                },
                compareFiveDate: function (ydDate) {
                    var aDate = new Date(this.getNowDate()); // 通过日期字符串，初始化第一个日期对象
                    var bDate = new Date(ydDate); // 同上，初始化第二个日期对象
                    var aDay = 24 * 60 * 60 * 1000; // 完整一天有24小时，将小时换算成毫秒时间戳
                    var diffDay = (bDate - aDate) / aDay; // 计算间隔天数（注意日期隐式转换）
                    // console.log(diffDay); // 2，23日-25日间隔2天
                    return diffDay;
                },
                deleteFileRP: function (item, i, pid) {
                    if (window.confirm("确定要删除该附件吗?")) {
                        if (pid || pid === 0) {
                            this.main[item][pid].repaymentParentList[i].interestFreeAttachName = "";
                            this.main[item][pid].repaymentParentList[i].interestFreeAttachUrl = "";
                            $("#" + item + "repaymentParentList" + pid + i).show();
                            //加这俩行为了刷新数据 无实际意义
                            // this.main[item].push(new Template['repaySFMentList']());
                            // this.main[item].splice(this.main[item].length - 1, 1);
                        } else {
                            if (item == 'availableList') {
                                this.main[item][i].interestFreeAttachName = "";
                                this.main[item][i].interestFreeAttachUrl = "";
                            } else {
                                this.main[item][i].interestFreeAttachName = "";
                                this.main[item][i].interestFreeAttachUrl = "";

                            }
                            $("#" + item + i).show();
                        }
                    }

                },
                compareDate: function (date1, date2) {
                    var oDate1 = new Date(date1);
                    var oDate2 = new Date(date2);
                    if (oDate1.getTime() > oDate2.getTime()) {
                        return true;
                    } else {
                        return false;
                    }
                },
                compareDateDE: function (date1, date2) {
                    var oDate1 = new Date(date1);
                    var oDate2 = new Date(date2);
                    if (oDate1.getTime() >= oDate2.getTime()) {
                        return true;
                    } else {
                        return false;
                    }
                },
                getNowDate: function () {
                    var now = new Date();
                    var year = now.getFullYear();
                    var month = (now.getMonth() + 1).toString();
                    var day = (now.getDate()).toString();
                    var hour = (now.getHours()).toString();
                    var minute = (now.getMinutes()).toString();
                    var second = (now.getSeconds()).toString();
                    if (month.length == 1) {
                        month = "0" + month;
                    }
                    if (day.length == 1) {
                        day = "0" + day;
                    }
                    if (hour.length == 1) {
                        hour = "0" + hour;
                    }
                    if (minute.length == 1) {
                        minute = "0" + minute;
                    }
                    if (second.length == 1) {
                        second = "0" + second;
                    }
                    var dateTime = year + "-" + month + "-" + day;
                    return dateTime;
                },
                changeRed: function (type, i) {
                    var flag = true;
                    var nowDate = this.getNowDate();
                    if (this.contract.main.haveDsdf == '0' && (type == 'repayRZMent' || type == 'repayRZDBMent')) {
                        flag = true;
                        return flag;
                    }
                    if (!this.main[type][i].actualRepaymentDate) {
                        if (this.compareDate(nowDate, this.main[type][i].repaymentDate)) {
                            flag = false;
                            return flag;
                        }
                    } else {
                        if ((this.main[type][i].remainingArrearss != '0' || this.main[type][i].overduePenalty != '0') && this.compareDate(nowDate, this.main[type][i].repaymentDate)) {
                            if (this.main[type][i].remainingArrearss != '0' || this.main[type][i].overduePenalty != '0') {
                                flag = false;
                                return flag;
                            }
                            if (this.compareDateDE(this.main[type][i].actualRepaymentDate, this.main[type][i].repaymentDate)) {
                                flag = false;
                                return flag;
                            }
                        }
                        if (this.main[type][i].repaymentParentList) {
                            for (var j = 0; j < this.main[type][i].repaymentParentList.length; j++) {
                                if (this.main[type][i].repaymentParentList[j].remainingArrearss != '0' && this.compareDate(nowDate, this.main[type][i].repaymentParentList[j].repaymentDate)) {
                                    if (this.compareDateDE(this.main[type][i].repaymentParentList[j].actualRepaymentDate, this.main[type][i].repaymentParentList[j].repaymentDate)) {
                                        flag = false;
                                        return flag;
                                    }
                                }
                            }
                        }
                    }
                    return flag;
                },

            }
            ,
            mounted: function () {
                var that = this;
                var flag = false;
                that.shOrSq = getUrlParamObj().shOrSq;
                if (that.shOrSq) {
                    var interestFreeAuditFlag;
                    if (that.shOrSq == 'sq') {
                        interestFreeAuditFlag = 0;
                    } else if (that.shOrSq == 'sh') {
                        interestFreeAuditFlag = 2;
                    }
                    that.pageType = getUrlParamObj().pageType;
                    $.wyui.postMethod(urlConfig.receivable.getInterestFreeListById, {
                        id: that.id,
                        interestFreeAuditFlag: interestFreeAuditFlag
                    }, function (data) {
                        that.contract = data;
                        that.contract.checkedIds = [];
                        that.contract.checkedIdString = "'',";
                        that.contract.checkedIdStrings = "";
                        for (var i = 0; i < data.repaymentFQList.length; i++) {
                            data.repaymentFQList[i].isCheck = false;
                            data.repaymentFQList[i].remark2 = '';
                            data.repaymentFQList[i].repaymentDate2 = '';
                            that.contract.checkedIdString = that.contract.checkedIdString + "'" + data.repaymentFQList[i].id + "',"
                            that.contract.checkedIdStrings = that.contract.checkedIdStrings + data.repaymentFQList[i].id + ","

                            if (data.repaymentFQList[i].repaymentParentList) {
                                if (data.repaymentFQList[i].repaymentParentList.length > 0) {
                                    for (var j = 0; j < data.repaymentFQList[i].repaymentParentList.length; j++) {
                                        if (j == (data.repaymentFQList[i].repaymentParentList.length - 1)) {
                                            data.repaymentFQList[i].repaymentParentList[j].hk = '1';
                                        }
                                    }
                                } else {
                                    console.log(i)
                                    data.repaymentFQList[i].hk = '1';
                                }
                            }
                        }
                        for (var i = 0; i < data.repaymentDKList.length; i++) {
                            data.repaymentDKList[i].isCheck = false;
                            data.repaymentDKList[i].remark2 = '';
                            data.repaymentDKList[i].repaymentDate2 = '';
                            that.contract.checkedIdString = that.contract.checkedIdString + "'" + data.repaymentDKList[i].id + "',"
                            that.contract.checkedIdStrings = that.contract.checkedIdStrings + data.repaymentDKList[i].id + ","

                            if (data.repaymentDKList[i].repaymentParentList) {
                                if (data.repaymentDKList[i].repaymentParentList.length > 0) {
                                    for (var j = 0; j < data.repaymentDKList[i].repaymentParentList.length; j++) {
                                        if (j == (data.repaymentDKList[i].repaymentParentList.length - 1)) {
                                            data.repaymentDKList[i].repaymentParentList[j].hk = '1';
                                        }
                                    }
                                } else {
                                    console.log(i)
                                    data.repaymentDKList[i].hk = '1';
                                }
                            }
                        }
                        for (var i = 0; i < data.repaymentRZList.length; i++) {
                            data.repaymentRZList[i].isCheck = false;
                            data.repaymentRZList[i].remark2 = '';
                            data.repaymentRZList[i].repaymentDate2 = '';
                            that.contract.checkedIdString = that.contract.checkedIdString + "'" + data.repaymentRZList[i].id + "',"
                            that.contract.checkedIdStrings = that.contract.checkedIdStrings + data.repaymentRZList[i].id + ","

                            if (data.repaymentRZList[i].repaymentParentList) {
                                if (data.repaymentRZList[i].repaymentParentList.length > 0) {
                                    for (var j = 0; j < data.repaymentRZList[i].repaymentParentList.length; j++) {
                                        if (j == (data.repaymentRZList[i].repaymentParentList.length - 1)) {
                                            data.repaymentRZList[i].repaymentParentList[j].hk = '1';
                                        }
                                    }
                                } else {
                                    console.log(i)
                                    data.repaymentRZList[i].hk = '1';
                                }
                            }
                        }
                        for (var i = 0; i < data.repaymentRZDBList.length; i++) {
                            data.repaymentRZDBList[i].isCheck = false;
                            data.repaymentRZDBList[i].remark2 = '';
                            data.repaymentRZDBList[i].repaymentDate2 = '';
                            that.contract.checkedIdString = that.contract.checkedIdString + "'" + data.repaymentRZDBList[i].id + "',"
                            that.contract.checkedIdStrings = that.contract.checkedIdStrings + data.repaymentRZDBList[i].id + ","

                            if (data.repaymentRZDBList[i].repaymentParentList) {
                                if (data.repaymentRZDBList[i].repaymentParentList.length > 0) {
                                    for (var j = 0; j < data.repaymentRZDBList[i].repaymentParentList.length; j++) {
                                        if (j == (data.repaymentRZDBList[i].repaymentParentList.length - 1)) {
                                            data.repaymentRZDBList[i].repaymentParentList[j].hk = '1';
                                        }
                                    }
                                } else {
                                    console.log(i)
                                    data.repaymentRZDBList[i].hk = '1';
                                }
                            }
                        }
                        for (var i = 0; i < data.repaymentSFList.length; i++) {
                            data.repaymentSFList[i].isCheck = false;
                            data.repaymentSFList[i].remark2 = '';
                            data.repaymentSFList[i].repaymentDate2 = '';
                            that.contract.checkedIdString = that.contract.checkedIdString + "'" + data.repaymentSFList[i].id + "',"
                            that.contract.checkedIdStrings = that.contract.checkedIdStrings + data.repaymentSFList[i].id + ","

                            if (data.repaymentSFList[i].repaymentParentList) {
                                if (data.repaymentSFList[i].repaymentParentList.length > 0) {
                                    for (var j = 0; j < data.repaymentSFList[i].repaymentParentList.length; j++) {
                                        if (j == (data.repaymentSFList[i].repaymentParentList.length - 1)) {
                                            data.repaymentSFList[i].repaymentParentList[j].hk = '1';
                                        }
                                    }
                                } else {
                                    console.log(i)
                                    data.repaymentSFList[i].hk = '1';
                                }
                            }
                        }
                        if (that.shOrSq == 'sh') {
                            that.contract.checkedIdString = that.contract.checkedIdString.substring(0, that.contract.checkedIdString.length - 1)
                            that.contract.checkedIdStrings = that.contract.checkedIdStrings.substring(0, that.contract.checkedIdStrings.length - 1)

                        } else if (that.shOrSq == 'sq') {
                            that.contract.checkedIdString = "";
                            that.contract.main.applyDepart = getCurrentUser().departName
                            that.contract.main.applyName = getCurrentUser().name
                            that.contract.main.applyNameId = getCurrentUser().id
                        }
                        console.log(that.contract.checkedIdString)
                        that.auditors = data.auditors;
                        that.copiers = data.copiers;
                        that.history = data.history;
                        that.companyInfo = {city: data.main.city, province: data.main.province};
                        that.canUseMoney = that.contract.main.accountBalance;
                        if (data.repaymentFQList) {
                            for (var i = 0; i < data.repaymentFQList.length; i++) {
                                if (that.compareFiveDate(data.repaymentFQList[i].financingDate) > 0) {
                                    data.repaymentFQList[i].xyq = true;
                                    break;
                                }
                            }
                        }
                        if (data.repaymentDKList) {
                            for (var i = 0; i < data.repaymentDKList.length; i++) {
                                if (that.compareFiveDate(data.repaymentDKList[i].repaymentDate) > 0) {
                                    data.repaymentDKList[i].xyq = true
                                    break;
                                }
                            }
                        }
                        if (data.repaymentRZList) {
                            for (var i = 0; i < data.repaymentRZList.length; i++) {
                                if (that.compareFiveDate(data.repaymentRZList[i].repaymentDate) > 0) {
                                    data.repaymentRZList[i].xyq = true
                                    break;
                                }
                            }
                        }
                        if (data.repaymentRZDBList) {
                            for (var i = 0; i < data.repaymentRZDBList.length; i++) {
                                if (that.compareFiveDate(data.repaymentRZDBList[i].repaymentDate) > 0) {
                                    data.repaymentRZDBList[i].xyq = true
                                    break;
                                }
                            }
                        }
                        if (data.repaymentSFList) {
                            for (var i = 0; i < data.repaymentSFList.length; i++) {
                                if (that.compareFiveDate(data.repaymentSFList[i].repaymentDate) > 0) {
                                    data.repaymentSFList[i].xyq = true
                                    break;
                                }
                            }
                        }
                        if (data.financingRZList) {
                            for (var i = 0; i < data.financingRZList.length; i++) {
                                if (that.compareFiveDate(data.financingRZList[i].financingDate) > 0) {
                                    data.financingRZList[i].xyq = true
                                    break;
                                }
                            }
                        }
                        if (data.financingRZDBList) {
                            for (var i = 0; i < data.financingRZDBList.length; i++) {
                                if (that.compareFiveDate(data.financingRZDBList[i].financingDate) > 0) {
                                    data.financingRZDBList[i].xyq = true
                                    break;
                                }
                            }
                        }
                        that.main.repayFQMent = data.repaymentFQList;
                        that.main.repayDKMent = data.repaymentDKList;
                        that.main.repayRZMent = data.repaymentRZList;
                        that.main.repayRZDBMent = data.repaymentRZDBList;
                        that.contract.availableList = data.availableList;
                        that.main.repaySFMent = data.repaymentSFList;
                        that.main.repayRZMentFn = data.financingRZList;
                        that.main.repayRZMentFnDB = data.financingRZDBList;
                        that.contract.regionManagerList = data.regionManagerList;//区域经理
                        that.contract.bigRegionManagerList = data.bigRegionManagerList;//大区经理
                        that.contract.regionSupportList = data.regionSupportList;//区域支持
                        that.contract.creditorManagerList = data.creditorManagerList;//债权经理
                        that.contract.dataManagerList = data.dataManagerList;//应收专员
                        if (that.contract.main.customerCredit) {
                            if (that.contract.main.customerCredit.indexOf("T") != -1 || that.contract.main.customerCredit.indexOf("F") != -1 || that.contract.main.customerCredit.indexOf("已结清") != -1) {
                                that.customerTypeList.splice(0, 1);
                            } else {
                                that.customerTypeList[1].value = that.contract.main.customerCredit;
                                that.customerTypeList[1].name = that.contract.main.customerCredit;
                            }

                        } else {
                            that.customerTypeList.splice(0, 1);
                        }
                        if (that.contract.collectionList) {
                            for (var i = 0; i < that.contract.collectionList.length; i++) {
                                if (!that.contract.collectionList[i].createUserName) {
                                    that.contract.collectionList[i].createUserName = getCurrentUser().name
                                }
                            }
                        }
                        // that.init();
                        that.hide();
                        $("body").trigger('click');

                    });
                }
            }
        })
    ;
</script>
<script>
    $("#jgregionManagerName").autoComplete({
        url: server.ip + urlConfig.contract.getRegionManagerByUserId,
        render: function (users, panel) {
            for (var i = 0; i < users.length; i++) {
                $("<li></li>").data("autoComplete",
                    users[i]).html("<a>" + users[i].name + "&nbsp;&nbsp;&nbsp;" +
                    "(" + "&nbsp;" + users[i].companyName + "-" + users[i].departName + "-" + users[i].roleName + "&nbsp;" + ") " + "</a>")
                    .appendTo(panel);
            }
        },
        selected: function (user) {
            app.contract.main.takeOverManagerId = user.id;
            app.contract.main.takeOverManager = user.name;
            return false;
        },
        height: 210,
        width: 420
    })
    ;
    Vue.directive('fj', {
        inserted: function (el, binding) {
            var demo = $("#" + el.id)
            app.init(demo);
        }
    });
</script>
</body>
</html>